Skip to content

fix: preserve redis notification metadata#1154

Open
napiany wants to merge 1 commit into
mozilla-services:mainfrom
napiany:fix/redis-preserve-notification-metadata
Open

fix: preserve redis notification metadata#1154
napiany wants to merge 1 commit into
mozilla-services:mainfrom
napiany:fix/redis-preserve-notification-metadata

Conversation

@napiany

@napiany napiany commented Apr 24, 2026

Copy link
Copy Markdown

Description

Preserve ttl, topic, and sortkey_timestamp when serializing Redis-backed StorableNotification records.

The Redis save path creates zset members using Notification::chidmessageid(), which depends on topic or sortkey_timestamp. The current stored JSON omits those fields, so after deserialization the notification falls back to the legacy channel_id:version message ID. That makes reconnect/backlog cleanup delete the wrong Redis member/key and can cause repeated replay of stored notifications.

This patch keeps the metadata in the stored JSON.

Keep ttl, topic, and sortkey_timestamp in Redis-stored notifications so message IDs remain stable after JSON round-trips.

Previously Redis zset members were created from the full notification metadata, but the stored JSON omitted that metadata. On reconnect, deserialized notifications fell back to legacy message IDs and cleanup deleted the wrong Redis entries, causing repeated backlog replay.
@napiany napiany marked this pull request as ready for review April 24, 2026 12:31
@pjenvey

pjenvey commented May 1, 2026

Copy link
Copy Markdown
Member

Have you (or anyone else) ran the redis backend against the integration test suite (and are they currently runnable against it)?

I'm wondering if they caught/would have caught such a bug, or should a new test showing this issue be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants